import atexit
from concurrent.futures import ThreadPoolExecutor


pool = ThreadPoolExecutor(max_workers=20)


def cleanup():
    # 执行清理工作
    print('ThreadPoolExecutor shutdown')
    pool.shutdown()


atexit.register(cleanup)
